﻿/* 
	PureMVC CSharp / WPF / EmployeeAdmin Demo - Login
	By Andy Adamczak <andy.adamczak@puremvc.org>
	Copyright(c) 2009 Andy Adamczak, Some rights reserved.
*/

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.ObjectModel;
using System.Drawing;

using PureMVC.Patterns;
using PureMVC.Interfaces;

using GEF2.Model.Storage;

namespace GEF2.Model
{
	public class EntityProxy : Proxy, IProxy
	{
		public new const string NAME = "EntityProxy";

        public EntityProxy()
			: base(NAME, new ObservableCollection<Entity>())
		{
		}

        public IList<Entity> Entitys
        {
            get { return (IList<Entity>)Data; }
        }

		public void AddEntity(Entity entity)
		{
			Entitys.Add(entity);
		}

        public void DeleteEntity(Entity entity)
        {
            Entitys.Remove(entity);
        }

        public Entity NewEntity(String name, Point point)
        {
            Entity entity = new Entity(name, point.X, point.Y);
            Entitys.Add(entity);
            return entity;
        }

	}
}
